<template>
  <!-- 组件的结构 -->
  <div class="demo">
    <h1>名称:{{ name }}</h1>
    <h1>地址:{{ address }}</h1>
    <button @click="showX">点我输出X</button>
  </div>
</template>

<script>
//组件的交互
export default {
  name: "School",
  data() {
    return {
      name: "黑马",
      address: "西安",
    };
  },
  methods: {
    showX() {
      console.log(this.x);
    },
  },
};
</script>

<style>
/* 组件的样式 */
.demo {
  background-color: orange;
}
</style>